<script>
	import {
		userinfo
	} from '@/api/api.js';
	export default {
		onLaunch: function() {

		},
		onLoad() {
			// this.handleMessagenumber()
		},
		onShow: async function() {
			this.handleMessagenumber()
			// console.log("？？？？？？",res.data.memssage_count)
		},
		onHide: function() {
			// console.log('App Hide')
		},
		methods: {
			async handleMessagenumber() {
				let res = await userinfo()
				if (res.data.memssage_count > 0) {
					uni.setTabBarBadge({
						index: 2,
						text: res.data.memssage_count.toString()
					})
				}
			},
		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";

	/*每个页面公共css */
	page {
		height: 100%;
		background: #F7F8FA;
	}
</style>